from django.db import models
from hosting.clients.models import Account

# Create your models here.
class Unit(models.Model):
    name = models.CharField(max_length=50)

class Service(models.Model):
    name = models.CharField(max_length=50)
    unit = models.ForeignKey(Unit)

    def __unicode__(self):
        self.name

class PackService(models.Model):
    name = models.CharField(max_length=50)
    
    def __unicode__(self):
        self.name

    class Meta:
        ordering = ["name"]

class PackServiceDetail(models.Model):
    pack_service = models.ForeignKey(PackService)
    service = models.ForeignKey(Service)
    count = models.IntegerField()

class UsedService(models.Model):
    account = models.ForeignKey(Account)
    service = models.ForeignKey(Service)
    count = models.IntegerField()
